package xyz.boot.ssm.modules.mybatis.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.Map;

@Mapper
public interface LogDao {

    @Insert("INSERT INTO `test`.`t_log` (`log`, `time`) VALUES ( 'pool-1-thread-3-82.83312739419661', '2060-07-02 02:52:24')")
    void insert1();

    @Insert("INSERT INTO `test`.`t_log` (`log`, `time`) VALUES ( #{log}, #{time})")
    void insert2(@Param("log") String log,@Param("time") Date time);

    @Select("select count(1) from `test`.`t_log`")
    int count();

    @Select("select * from `test`.`t_log`")
    Map<String,Object> getById();
}
